package com.cn.xiaonuo.slbfinances.shopassets.controller;

import com.cn.xiaonuo.common.entity.BusinessMessage;
import com.cn.xiaonuo.slbfinances.shopassets.param.PageMerchantAssetsParam;
import com.cn.xiaonuo.slbfinances.shopassets.service.SlMerchantAssetsService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @BelongsProject: slb-reports-java
 * @Author: likui
 * @CreateTime: 2022-12-20  15:00
 * @Description: TODO
 */
@RestController
public class SlMerchantAssetsController {

    @Autowired
    private SlMerchantAssetsService slMerchantAssetsService;

    @ApiOperation(value = "定时汇总商家资产信息", notes = "定时汇总商家资产信息")
    @RequestMapping(value ="/api/common/merchantAssets/summarizeAssets", method = RequestMethod.POST)
    public BusinessMessage summarizeAssets(){
        return slMerchantAssetsService.summarizeAssets();
    }


    @ApiOperation(value = "商家资产信息列表", notes = "商家资产信息列表")
    @RequestMapping(value ="/api/merchantAssets/pageMerchantAssets", method = RequestMethod.POST)
    public BusinessMessage pageMerchantAssets(@RequestBody PageMerchantAssetsParam param){
        return slMerchantAssetsService.pageMerchantAssets(param);
    }

    @ApiOperation(value = "商家资产信息列表导出", notes = "商家资产信息列表导出")
    @RequestMapping(value ="/api/merchantAssets/merchantAssetsExcel", method = RequestMethod.GET)
    public void merchantAssetsExcel(HttpServletResponse response, PageMerchantAssetsParam param){
         slMerchantAssetsService.merchantAssetsExcel(response,param);
    }
}
